package alexico;

public class Matriz {
	private NodoMatriz[][] data;
	public Matriz(int i, int j) {
		data = new NodoMatriz[i][j];
	}
	
	public NodoMatriz getNodoMatriz(int estado, char caracter){
		return data[estado][getColumna(caracter)];
	}
	
	public void setNodoMatriz(int x, int y, NodoMatriz nodo){
		data[x][y] = nodo;
	}
	
	public int getColumna(char ch){
	    if (ch == '\n') return 1;
	    if ((ch>='a')&&(ch<='z')) return 2;
	    if ((ch>='A')&&(ch<='Z')) return 2;
	    if ((ch>='0')&&(ch<='9')) return 3;
	    if (ch == '-') return 4;
	    if (ch == '*') return 4;
	    if (ch == '/') return 4;
	    if (ch == ';') return 4;
	    if (ch == ',') return 4;
	    if (ch == '(') return 4;
	    if (ch == ')') return 4;
	    if (ch == '\\') return 5;
	    if (ch == '=') return 6;
	    if (ch == '<') return 7;	
	    if (ch == '>') return 8;
	    if (ch == '"') return 9;
	    if (ch == '!') return 10;
	    if (ch == '+') return 11;
	    if (ch == '\r') return 12;
	    return 0;
//	    if (ch == ' ') return 0;
//	    if (ch == '\t') return 0;
	  }
}
